package com.zhan.easyexcelorder.repository;

import com.zhan.utils.Constants;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

public interface SysMenuRepository extends PagingAndSortingRepository<SysMenu, Long>, JpaSpecificationExecutor<SysMenu> {

    @Query("select distinct parent.id from SysMenu where id in (?1) and parent.id not in (?1) and isDelete=" + Constants.NOT_DEL_VALUE)
    List<Long> findAllParentIds(List<Long> ids);

}
